<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>...</title>
		<link rel="stylesheet" href="../../css/base.css" />
		<script type="text/javascript" src="../../js/base.js" ></script>
		<script type="text/javascript" src="../../js/jquery-3.3.1.js" ></script>
	</head>
	<body>
	</body>
	<script>
		// 缓存支付宝auth_code
		var sparams = location.search.replace(/___/g,"&")

		localStorage.auth_code=getUrlParam(sparams).auth_code;
		localStorage.mchKey=getUrlParam(sparams).mchkey;
		isWeixin();

		// 获取商户信息
		function getMchInfo(){ 
	    	$.ajax({
				type:"post",
				url:url+"mch_info",
				data:{
					mchKey:localStorage.mchKey,
					browerType:localStorage.browerType,
					auth_code:localStorage.auth_code,
					code:"",
					wechatPayCode:"",
				},
				success:function(e){
					if(e.code=="0000"){
						localStorage.mchInfo=JSON.stringify(e.result);
						location.href="pay.html";
					} else {
						$('body').append(e);
                        $("form").attr("target", "_blank");
					}
				},
				error:function(e){
	    			hint(e.msg);
	    		}
			});
		};
		getMchInfo();
	</script>
</html>